<h2 class="h2-title">Quản lý pages !!!</h2>

<p><a href="<?=base_url()?>backend/pages/createpages" class="bnt"style="margin-bottom: 15px;">Tạo trang mới</a></p>

<div class="clear"></div>
<?php if($this->native_session->flashdata('msg')):?>
    <ul class="notification succ">
        <li class="notifi_img"><img src="<?=base_url()?>assets/backend/css/images/icons/tick_circle.png"/></li>

        <li class="msg"><?=$this->native_session->flashdata('msg')?></li>

        <li class="close"><img src="<?=base_url()?>assets/backend/css/images/icons/cross_grey_small.png"/></li>

    </ul><!--End of .notification -->
<?php endif?>

<table class="pretty">
                    <thead>
                        <tr>
                            <th>Mã trang</th>
                            <th>Tên trang</th>
                            <th>Vị trí</th>
                            <th>Chế độ mở</th>
                            <th>Trạng thái</th>
                            <th>Sửa</th>
                            <th>Xoá</th>
                        </tr>
                    </thead>

                    <tbody>
                        <?php if(isset($msg)):?>
                            <td colspan="7"><?= $msg ?></td>
                        <?php else:?>
                            <?php foreach($pages as $page):?>
                                <tr>
                                <td><?=$page->pages_id?></td>
                                <td><?=$page->pages_name?></td>
                                <td><?=$page->pages_order?></td>
                                <td><?php if($page->pages_open == 1)  echo "Mở trang hiện tại"; else echo "Trang mới"; ?></td>
                                <td><?php if($page->pages_status == 1)  echo "<a href='".base_url()."backend/pages/changestt/".$page->pages_id."/0'>Hiển thị</a>"; else echo "<a href='".base_url()."backend/pages/changestt/".$page->pages_id."/1'>Ẩn</a>"; ?></td>
                                <td>
                                    <a href="<?=base_url()?>backend/pages/editpages/<?=$page->pages_id?>" class="edit">
                                        <img src="<?=base_url()?>assets/backend/css/images/edit.png"/>
                                    </a>
                                </td>
                                <td>
                                    <a href="<?=base_url()?>backend/pages/delpages/<?=$page->pages_id?>" class="delete">
                                        <img src="<?=base_url()?>assets/backend/css/images/delete.png"/>
                                    </a>
                                </td>
                                </tr>
                            <?php endforeach;?>
                        <?php endif;?>
                    </tbody>
                </table>